|
Eclipse Platform Pre-release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.team.core.subscribers.TeamSubscriber
A TeamSubscriber provides synchronization between local resources and a remote location that is used to share those resources. [Note: How can we allow the refresh() operation to optimize the sync calculation based on the currently configured compare criteria?]
Constructor Summary | |
TeamSubscriber()
|
Method Summary | |
void |
addListener(ITeamResourceChangeListener listener)
Adds a listener to this team subscriber. |
protected void |
fireTeamResourceChange(TeamDelta[] deltas)
Fires a team resource change event to all registered listeners Only listeners registered at the time this method is called are notified. |
SyncInfo[] |
getAllOutOfSync(IResource[] resources,
int depth,
IProgressMonitor monitor)
Return an array of all out-of-sync resources (getKind() != 0) that occur under the given resources to the specified depth. |
abstract ComparisonCriteria[] |
getComparisonCriterias()
Returns the list of available comparison criteria supported by this subscriber. |
abstract ComparisonCriteria |
getCurrentComparisonCriteria()
Returns the comparison criteria that will be used by the sync info created by this subscriber. |
abstract String |
getDescription()
Return the description of this subscription, in a format that is suitable for display to an end user. |
abstract IRemoteResource |
getRemoteResource(IResource resource)
Returns a handle to the remote resource corresponding to the given resource, or null if there is no corresponding resource
edition. |
abstract SyncInfo |
getSyncInfo(IResource resource,
IProgressMonitor monitor)
Returns synchronization info for the given resource, or null if there is no synchronization info
because the subscriber does not apply to this resource. |
abstract boolean |
isSupervised(IResource resource)
Returns true if this resource is supervised by this subscriber. |
abstract boolean |
isThreeWay()
Answers true if the base tree is maintained by this subscriber. |
abstract IResource[] |
members(IResource resource)
Returns all non-transient member resources of the given resource. |
abstract void |
refresh(IResource[] resources,
int depth,
IProgressMonitor monitor)
Refreshes the resource hierarchy from the given resources and their children (to the specified depth) from the corresponding resources in the remote location. |
void |
removeListener(ITeamResourceChangeListener listener)
Removes a listener previously registered with this team subscriber. |
abstract IResource[] |
roots()
Returns the list of root resources this subscriber considers for synchronization. |
abstract void |
setCurrentComparisonCriteria(String id)
Set the current comparison criteria to the one defined by the given id. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TeamSubscriber()
Method Detail |
public abstract String getDescription()
public abstract boolean isSupervised(IResource resource) throws TeamException
true
if this resource is supervised by this subscriber.
A supervised resource is one for which this subscriber maintains the synchronization
state. Returns false
in all other cases.
true
if this resource is supervised, and
false
otherwise
TeamException
public abstract IResource[] members(IResource resource) throws TeamException
This is a fast operation; the repository is not contacted.
[Issue1 : Is there any filtering on the members? Just the ones that changed in some way, or *every member*? ]
resource
- the resource
CoreException
- if this request fails. Reasons include:
TeamException
public abstract IResource[] roots()
members
to navigate the resources managed by this subscriber.
TeamException
public abstract IRemoteResource getRemoteResource(IResource resource) throws TeamException
null
if there is no corresponding resource
edition.
This is a fast operation; the repository is not contacted.
resource
- the resource
CoreException
- if this request fails. Reasons include:
TeamException
public abstract SyncInfo getSyncInfo(IResource resource, IProgressMonitor monitor) throws TeamException
null
if there is no synchronization info
because the subscriber does not apply to this resource.
Note that sync info may be returned for non-existing or for resources which have no corresponding remote resource.
This method may take some time; it depends on the comparison criteria that is used to calculate the synchronization state (e.g. using content or only timestamps).
resource
- the resource of interest
TeamException
public abstract void refresh(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException
Typical synchronization operations use the statuses computed by this method as the basis for determining what to do. It is possible for the actual sync status of the resource to have changed since the current local sync status was refreshed. Operations typically skip resources with stale sync information. The chances of stale information being used can be reduced by running this method (where feasible) before doing other operations. Note that this will of course affect performance.
The depth parameter controls whether refreshing is performed
on just the given resource (depth=DEPTH_ZERO
),
the resource and its children (depth=DEPTH_ONE
),
or recursively to the resource and all its descendents (depth=DEPTH_INFINITE
).
Use depth DEPTH_ONE
, rather than depth
DEPTH_ZERO
, to ensure that new members of a project
or folder are detected.
This method might change resources; any changes will be reported in a subsequent resource change event indicating changes to server sync status.
This method contacts the server and is therefore long-running; progress and cancellation are provided by the given progress monitor.
resources
- the resourcesdepth
- valid values are DEPTH_ZERO
,
DEPTH_ONE
, or DEPTH_INFINITE
monitor
- progress monitor, or null
if progress
reporting and cancellation are not desired
OK
if there were no problems;
otherwise a description (possibly a multi-status) consisting of
low-severity warnings or informational messages.
CoreException
- if this method fails. Reasons include:
TeamException
public abstract ComparisonCriteria[] getComparisonCriterias()
public abstract ComparisonCriteria getCurrentComparisonCriteria()
public abstract void setCurrentComparisonCriteria(String id) throws TeamException
TeamException
public abstract boolean isThreeWay()
true
if the base tree is maintained by this subscriber. If the base
tree is not considered than the subscriber can be considered as not supported three-way
comparisons. Instead comparisons are made between the local and remote only without
consideration for the base.
public void addListener(ITeamResourceChangeListener listener)
Team resource change listeners are informed about state changes that affect the resources supervised by this subscriber.
listener
- a team resource change listenerpublic void removeListener(ITeamResourceChangeListener listener)
listener
- a team resource change listenerprotected void fireTeamResourceChange(TeamDelta[] deltas)
public SyncInfo[] getAllOutOfSync(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException
A return value of an empty array indicates that there are no out-of-sync resources
supervised by the subscriber. A return of null
indicates that the
subscriber does not support this operation in an optimized fashion. In this case,
the caller can determine the out-of-sync resources by traversing the resource
structure form the roots of the subscriber (@see getRoots()
).
resources
- depth
- monitor
-
TeamException
|
Eclipse Platform Pre-release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |